package com.caits.lbs.framework.bean.common;

import java.io.Serializable;

import com.caits.lbs.framework.utils.JsonUtils;


/**
 * <p>ApiResult</p>
 * <p>通用的接口返回对象</p>
 *
 * @author		周华彬(zhouhuabin@sinoiov.com, zhou_hua_bin@163.com)
 * @version		0.0.0
 * <table style="border:1px solid gray;">
 * <tr>
 * <th width="100px">版本号</th><th width="100px">动作</th><th width="100px">修改人</th><th width="100px">修改时间</th>
 * </tr>
 * <!-- 以 Table 方式书写修改历史 -->
 * <tr>
 * <td>0.0.0</td><td>创建类</td><td>admin</td><td>2017年6月29日 下午5:59:30</td>
 * </tr>
 * <tr>
 * <td>XXX</td><td>XXX</td><td>XXX</td><td>XXX</td>
 * </tr>
 * </table>
*/
public class ApiResult<T> implements Serializable {

	/** 变量:TODO,类型:long */
	private static final long serialVersionUID = 212100946151676086L;

	/** 变量:消息头,类型:ApiResultHead */
	protected ApiResultHead head;  

	/** 变量:签名字符串,类型:String */
	protected String sign;  
		
	/** 变量:业务参数,类型:T */
	private T body; 

	@Override
	public String toString() {
		return JsonUtils.getJsonStringFromObject(this);
	}

	public ApiResult() {
		super();
	}
	

	public ApiResultHead getHead() {
		return head;
	}


	public void setHead(ApiResultHead head) {
		this.head = head;
	}


	public String getSign() {
		return sign;
	}


	public void setSign(String sign) {
		this.sign = sign;
	}

	public void setBody(T body) {
		this.body = body;
	}
	public ApiResult(T body) {
		super();
		this.body = body;
		this.head  =ApiResultHead.getSuccess();
	}
	
	
	public ApiResult(ApiResultHead head) {
		super();
		this.head  =head;
	}

	public T getBody() {
		return body;
	}
	

	
}
